import 'package:flutter/material.dart';
import 'package:flutter_douban/config/app_colors.dart';
import 'package:flutter_douban/model/user_model.dart';

class AvatarRecommendView extends StatefulWidget {
  final UserModel? model;

  const AvatarRecommendView({Key? key,this.model,}) : super(key: key);

  @override
  _AvatarRecommendViewState createState() => _AvatarRecommendViewState();
}

class _AvatarRecommendViewState extends State<AvatarRecommendView> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      margin: EdgeInsets.only(left: 10,right: 10),
      height: 60,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          Container(
            width: 34,
            height: 34,
            decoration: BoxDecoration(
              color: AppColors.page,
              borderRadius: BorderRadius.circular(17),
            ),
            child: ClipOval(
              child: FadeInImage.assetNetwork(
                placeholder: 'assets/images/common/lazy-1.png',
                image: widget.model!.p!,
                fit: BoxFit.cover,
              ),
            ),
          ),
          SizedBox(width: 8,),
          Text(
            widget.model!.n!,
            maxLines: 1,
            overflow: TextOverflow.ellipsis,
            style: TextStyle(
              fontSize: 13,
              fontWeight: FontWeight.bold,
              color: AppColors.black,
            ),
          ),
          SizedBox(width: 8,),
          Text(
            'LV.${widget.model!.lvl.toString()}',
            overflow: TextOverflow.ellipsis,
            style: TextStyle(
                fontSize: 11,
                color: AppColors.yellow,
                fontStyle: FontStyle.italic,
                fontWeight: FontWeight.bold
            ),
          ),
        ],
      ),
    );
  }
}
